package cn.itsource.itsource.controller;

import cn.itsource.itsource.domain.Detail;
import cn.itsource.itsource.domain.LinYu;
import cn.itsource.itsource.query.DetailQuery;
import cn.itsource.itsource.service.IDetailService;
import cn.itsource.itsource.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("/detail")
public class DetailController {

    @Autowired
    private IDetailService detailService;

    @PostMapping("/pagelistbyid")
    @ResponseBody
    public AjaxResult pageListById(@RequestBody DetailQuery query){

        return detailService.pageListById(query);

    }
    @PostMapping("/saveorupdate")
    @ResponseBody
    public AjaxResult saveOrUpdate(@RequestBody Detail detail){

        return detailService.saveOrUpdate(detail);
    }

    @GetMapping("/del")
    @ResponseBody
    public AjaxResult del(Long id){

        return detailService.del(id);
    }
}
